//Sat Jul 30 12:28:53 CDT 2011
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;

class GroceryBagger {
public:
	int minimumBags(int, vector <string>);
};

int GroceryBagger::minimumBags(int p, vector <string> item) {
	sort(item.begin(), item.end());
	string str = "";
	int ret = 0;
	int count = 0;
	for(int i=0; i<item.size(); i++){
		if(item[i] != str){
			count = 1;
			ret++;
		}else{
			if(count>=p){
				count = 1;
				ret++;
			}else
				count++;
		}
		str = item[i];
	}
	return ret;
}


//Powered by [KawigiEdit] 2.0!
